<!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head>
<title>Kukbuk - Edycja książki</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- Bootstrap CSS -->
<link rel="stylesheet" type="text/css"
	href="../../../../css/bootstrap.min.css"
	th:href="@{/css/bootstrap.min.css}" />
<link rel="stylesheet" type="text/css" href="../../css/custom.css"
	th:href="@{/css/custom.css}" />
</head>

<body>
	<!-- TOP MENU -->
	<div th:substituteby="template :: top-menu"></div>
	<!-- /TOP MENU -->

	<!-- MAIN CONTAINER -->
	<div class="container">
		<div class="row">
			<div class="page-header">
				<h1>Edycja książki</h1>
			</div>
		</div>

		<!-- MESSAGE BOXES -->
		<div class="row" th:include="template :: message-boxes"></div>
		<!-- /MESSAGE BOXES -->

		<div class="row">
			<form class="form-horizontal"
				th:action="@{'/user/cookbook/edit/' + ${id}}" th:object="${form}"
				method="POST">
				<fieldset>
					<div class="control-group"
						th:classappend="${#fields.hasErrors('name')}? 'error'">
						<label class="control-label" for="name">Nazwa</label>
						<div class="controls">
							<input type="text" class="input-xlarge" id="name"
								th:field="*{name}" th:value="${form.name}"></input> <span
								class="help-inline" th:if="${#fields.hasErrors('name')}"
								th:errors="*{name}">ERROR</span>
							<p class="help-block">Wpisz nazwę składającą się z minimum 5
								oraz maksimum 50 znaków.</p>
						</div>
					</div>

					<div class="control-group"
						th:classappend="${#fields.hasErrors('description')}? 'error'">
						<label class="control-label" for="description">Opis</label>
						<div class="controls">
							<textarea class="input-xlarge" id="description"
								th:field="*{description}" th:text="${form.description}"></textarea>
							<span class="help-inline"
								th:if="${#fields.hasErrors('description')}"
								th:errors="*{description}">ERROR</span>
						</div>
					</div>


					<div class="control-group"
						th:classappend="${#fields.hasErrors('isPrivate')}? 'error'">
						<label class="control-label" for="isPrivate">Czy dany
							przepis jest prywatny? </label>
						<div class="controls">
							<label class="checkbox"> <input type="checkbox"
								id="isPrivate" th:field="*{isPrivate}" /> Tak
							</label>
							<p th:if="${#fields.hasErrors('isPrivate')}">
								<span class="help-inline" th:errors="*{isPrivate}">ERROR</span>
							</p>
							<p class="help-block">Prywatne przepisy nie są udostępniane
								innym użytkownikom</p>
						</div>
					</div>


					<div class="form-actions">
						<button class="btn btn-primary" type="submit">
							<i class="icon-ok icon-white"></i> Zatwierdź
						</button>
					</div>
				</fieldset>
			</form>
		</div>
	</div>
	<!-- /MAIN CONTAINER -->

	<!-- ======================================================== -->
	<!-- Scripts at bottom of page means faster loading times. -->
	<!-- Latest jQuery -->
	<script type="text/javascript"
		src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
	<!-- Bootstrap -->
	<script type="text/javascript" src="../../../js/bootstrap.min.js"
		th:src="@{/js/bootstrap.min.js}"></script>
</body>
</html>